<!--
  描述：基础配置-单位配置表详情页
  @author xujie
  @since 2021-03-01 09:35:57
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss">
    <title>新增或编辑分类</title>
</head>
<body>

<div class="layui-fluid">

    <blockquote class="layui-elem-quote layui-text">
        <zmn th:text="${(unit.unitId == null) ? '新增单位配置' : '修改单位配置'}"></zmn>
    </blockquote>

    <div class="layui-card">
        <form method="post" action="" class="layui-form" lay-filter="zmn-form">

            <input type="hidden" name="unitId" th:value="${unit.unitId}"/>

            <div class="layui-card-header" style="margin-top:10px;"><b style="font-size: 12px">单位将同时应用于：前台产品、后台产品、增值产品、计价器产品、项目的单位选择</b></div>
            <div class="layui-split">&nbsp;</div>


            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">名称：</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline">
                        <input type="text" name="unitName" th:value="${unit.unitName}" placeholder="单位名称"
                               lay-verify="required|nameLength" autocomplete="off" class="layui-input" maxlength="10"/>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">排序：</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline">
                        <input type="text" name="sort" th:value="${unit.sort}" placeholder="排序"
                                class="layui-input" lay-verify="positive"
                               autocomplete="off" onkeyup="this.value=this.value.replace(/\D/g,'')"
                               onafterpaste="this.value=this.value.replace(/\D/g,'')"/>
                    </div>
                </div>
            </div>


            <zmn th:if="${unit.unitId > 0}">
                <div class="layui-card-header"><b>其他信息</b></div>
                <div class="layui-split">&nbsp;</div>
                <div class="layui-form-item layui-form-item-xs">
                    <label class="layui-form-label">修改人/时间</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid layui-word-aux"
                             th:text="${unit.updater} + '&nbsp;/&nbsp;' + ${#dates.format(unit.updateTime, 'yyyy-MM-dd HH:mm:ss')}">
                            修改人/时间
                        </div>
                    </div>
                </div>
                <div class="layui-form-item layui-form-item-xs">
                    <label class="layui-form-label">创建人/时间</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid layui-word-aux"
                             th:text="${unit.creater} + '&nbsp;/&nbsp;' + ${#dates.format(unit.createTime, 'yyyy-MM-dd HH:mm:ss')}">
                            创建人/时间
                        </div>
                    </div>
                </div>
            </zmn>

            <div class="layui-split">&nbsp;</div>
            <div class="layui-form-item layui-layout-admin">
                <div class="layui-input-block">
                    <div class="layui-footer" style="left: 0;">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-form-submit" th:if="${#authPermit.checkPermit('/unit/addEdit.action')}">保存</button>
                        <button class="layui-btn layui-btn-primary info-form-cancel"
                                id="zmn-identity-info-form-cancel">取消
                        </button>
                    </div>
                </div>
            </div>

        </form>

    </div>

</div>

<script type="text/javascript" th:inline="javascript">

    let json = {
        unit: [[${unit}]]
    };

    layui.config({
        base: "/static/lay/",
        version: 20210301093557
    }).extend({
        index: "lib/index",
        plat_unit_detail: "unit/zmn.plat.unit.edit",
    }).use(['index', 'plat_unit_detail']);

</script>
</body>
</html>